import service from "./index.js";
import qs from "qs";

const collectApi = {
    // 收藏商品
    insert(goodsId) {
        return service.post(`/collect/${goodsId}`);
    },
    //取消收藏
    delete(id) {
        return service.delete(`/collect/${id}`);
    },
    //根据商品id和用户id查询
    selectByGoodsIdAndUserId(goodsId) {
        return service.get(`/collect/${goodsId}`);
    },
    //根据userId查询收藏记录
    selectByUserId(pageNum, pageSize) {
        return service.get(`/collect`, {
            params: {
                pageNum,
                pageSize
            }
        });
    }
}


export default collectApi;